<template>
	<view>
		<web-view :src="src"></web-view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				src:'',
				order:'',
				type:2
			}
		},
		onLoad(e) {
			this.src = e.url
			this.order = e.order
			this.type = e.type
			this.eyepay(e.order)
		},
		methods:{
			eyepay(order){
				this.$Request({
					method: 'POST',
					url: '/api/index/getOrderStatus',
					data: {
						order_no: order
					}
				}).then(res => {
					if (res.code == 2) {
						setTimeout(()=>{
							this.eyepay(this.order)
						},2000)
					}else{
						uni.showToast({
							title:'支付成功!',
							icon:'none'
						})
						if(this.type == 2){
							setTimeout(()=>{
								uni.switchTab({
									url:'/pages/factory/index'
								})
							},1000)
						}else{
							setTimeout(()=>{
								uni.switchTab({
									url:'/pages/home/index'
								})
							},1000)
						}
					}
				})
				
			}
		}
	}
</script>

<style>
</style>